Clean up shadow code presence in common source files.
Signed-off-by: Keir Fraser <keir@xensource.com>
421098b7Z6OwjZnrTZkh34DoDfcjrA xen/include/asm-ia64/regionreg.h
421098b707cY5YluUcWK5Pc-71ETVw xen/include/asm-ia64/regs.h
4214e2f3fbO_n9Z1kIcBR83d7W4OJw xen/include/asm-ia64/serial.h
-421098b7czhvyPGFa5nskL0N4vNvFw xen/include/asm-ia64/shadow.h
421098b7GkWOnlzSmPvNAhByOSZ1Dw xen/include/asm-ia64/time.h
421098b7FK3xgShpnH0I0Ou3O4fJ2Q xen/include/asm-ia64/tlb.h
421098b78IGdFOGUlPmpS7h_QBmoFg xen/include/asm-ia64/vcpu.h
40589969nPq3DMzv24RDb5LXE9brHw xen/include/xen/sched-if.h
3ddb79c0LzqqS0LhAQ50ekgj4oGl7Q xen/include/xen/sched.h
403a06a7H0hpHcKpAiDe5BPnaXWTlA xen/include/xen/serial.h
+4252c315hw0xXYMKIfFzhomi1M1yNA xen/include/xen/shadow.h
3ddb79c14dXIhP7C2ahnoD08K90G_w xen/include/xen/slab.h
3ddb79c09xbS-xxfKxuV3JETIhBzmg xen/include/xen/smp.h
3ddb79c1Vi5VleJAOKHAlY0G2zAsgw xen/include/xen/softirq.h
#include <xen/trace.h>
#include <xen/console.h>
#include <xen/physdev.h>
-#include <asm/shadow.h>
#include <public/sched_ctl.h>
#define TRC_DOM0OP_ENTER_BASE 0x00020000
#include <xen/perfc.h>
#include <xen/sched.h>
#include <xen/event.h>
+#include <xen/shadow.h>
#include <asm/domain_page.h>
-#include <asm/shadow.h>
/*
* To allow safe resume of do_dom_mem_op() after preemption, we need to know
if ( test_and_clear_bit(_PGC_allocated, &page->count_info) )
put_page(page);
- if ( unlikely(shadow_mode_enabled(d)) )
- {
- // XXX This needs more thought. This isn't pretty,
- // and it's not fast. But it's a place holder.
- //
- shadow_lock(d);
- if ( page_out_of_sync(page) )
- __shadow_sync_mfn(d, mpfn + j);
- shadow_remove_all_access(d, mpfn + j);
-
- if (page->count_info != 1)
- {
- printk("free_dom_mem in shadow mode didn't release page "
- "mfn=%p c=%p\n", mpfn+j, page->count_info);
- shadow_unlock(d);
- audit_domain(d);
- BUG();
- }
- shadow_unlock(d);
- }
+ shadow_sync_and_drop_references(d, page);
put_page(page);
}
#include <xen/time.h>
#include <xen/console.h>
#include <xen/softirq.h>
-#include <asm/shadow.h>
#include <public/dom0_ops.h>
#include <asm/domain_page.h>
#include <asm/debugger.h>
#include <xen/config.h>
#include <xen/sched.h>
-#include <asm/mm.h>
-#include <asm/shadow.h>
+#include <xen/shadow.h>
+#include <xen/mm.h>
#define PIN_FAIL(_lbl, _rc, _f, _a...) \
do { \
#include <xen/slab.h>
#include <xen/irq.h>
#include <xen/softirq.h>
+#include <xen/shadow.h>
#include <asm/domain_page.h>
#include <asm/page.h>
-#include <asm/shadow.h>
/*
* Comma-separated list of hexadecimal page numbers containing bad bytes.
for ( i = 0; i < (1 << order); i++ )
{
- if ( ((pg[i].u.inuse.type_info & PGT_count_mask) != 0) &&
- shadow_mode_enabled(d) )
- {
- // XXX This needs more thought...
- //
- printk("%s: needing to call shadow_remove_all_access for mfn=%p\n",
- __func__, page_to_pfn(&pg[i]));
- printk("Amfn=%p c=%p t=%p\n", page_to_pfn(&pg[i]),
- pg[i].count_info, pg[i].u.inuse.type_info);
- shadow_lock(d);
- shadow_remove_all_access(d, page_to_pfn(&pg[i]));
- shadow_unlock(d);
- printk("Bmfn=%p c=%p t=%p\n", page_to_pfn(&pg[i]),
- pg[i].count_info, pg[i].u.inuse.type_info);
- }
-
+ shadow_drop_references(d, &pg[i]);
ASSERT((pg[i].u.inuse.type_info & PGT_count_mask) == 0);
pg[i].tlbflush_timestamp = tlbflush_current_time();
pg[i].u.free.cpu_mask = d->cpuset;
+++ /dev/null
-
-#define shadow_lock_init(d) do {} while(0)
-#define shadow_mode_init(d) do {} while(0)
}
}
+static inline void shadow_drop_references(
+ struct domain *d, struct pfn_info *page)
+{
+ if ( likely(!shadow_mode_enabled(d)) ||
+ ((page->u.inuse.type_info & PGT_count_mask) == 0) )
+ return;
+
+ /* XXX This needs more thought... */
+ printk("%s: needing to call shadow_remove_all_access for mfn=%p\n",
+ __func__, page_to_pfn(page));
+ printk("Before: mfn=%p c=%p t=%p\n", page_to_pfn(page),
+ page->count_info, page->u.inuse.type_info);
+
+ shadow_lock(d);
+ shadow_remove_all_access(d, page_to_pfn(page));
+ shadow_unlock(d);
+
+ printk("After: mfn=%p c=%p t=%p\n", page_to_pfn(page),
+ page->count_info, page->u.inuse.type_info);
+}
+
+static inline void shadow_sync_and_drop_references(
+ struct domain *d, struct pfn_info *page)
+{
+ if ( likely(!shadow_mode_enabled(d)) )
+ return;
+
+ /* XXX Needs more thought. Neither pretty nor fast: a place holder. */
+ shadow_lock(d);
+
+ if ( page_out_of_sync(page) )
+ __shadow_sync_mfn(d, page_to_pfn(page));
+
+ shadow_remove_all_access(d, page_to_pfn(page));
+
+ if ( page->count_info != 1 )
+ {
+ printk("free_dom_mem in shadow mode didn't release page "
+ "mfn=%p c=%p\n", page_to_pfn(page), page->count_info);
+ shadow_unlock(d);
+ audit_domain(d);
+ BUG();
+ }
+
+ shadow_unlock(d);
+}
/************************************************************************/
#define perfc_incr(x) ((void)0)
#define perfc_decr(x) ((void)0)
#define perfc_incrc(x) ((void)0)
+#define perfc_decrc(x) ((void)0)
#define perfc_incra(x,y) ((void)0)
+#define perfc_decra(x,y) ((void)0)
#define perfc_add(x,y) ((void)0)
#define perfc_addc(x,y) ((void)0)
#define perfc_adda(x,y,z) ((void)0)
--- /dev/null
+
+#ifndef __XEN_SHADOW_H__
+#define __XEN_SHADOW_H__
+
+#include <xen/config.h>
+
+#ifdef CONFIG_X86
+
+#include <asm/shadow.h>
+
+#else
+
+#define shadow_drop_references(_d, _p) ((void)0)
+#define shadow_sync_and_drop_references(_d, _p) ((void)0)
+
+#endif
+
+#endif /* __XEN_SHADOW_H__ */